<!DOCTYPE html>
<html>
<head>
<style>
.item1 { grid-area: header; }
.item2 { grid-area: menu; }
.item3 { grid-area: main; }
.item4 { grid-area: right; }
.item5 { grid-area: footer; }

.grid-container {
  display: grid;
  grid-template-areas:
    'header header header header header header'
    'menu menu main main main right'
    'footer footer footer footer footer footer';
  grid-template-columns: 100px 50px auto auto auto  100px;
  grid-gap: 10px;
  background-color: #2196F3;
  padding: 10px;
}

.grid-container > div {
  background-color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 20px 0;
  font-size: 30px;
}
</style>
</head>
<body>

<h1>grid-area 属性</h1>

<p>您可使用 <em>grid-area</em> 属性来命名网格项目。</p>

<p>通过在网格容器上使用 <em>grid-template-areas</em>属性，您可以在设置网格布局时引用该名称。</p>

<p>此网格布局包含六列三行：</p>

<div class="grid-container">
  <div class="item1">Header</div>
       
  <div class="item2">Menu</div>

  <div class="item3">Main</div>  

  <div class="item4">Right</div>
  
  <div class="item5">Footer</div>
</div>

</body>
</html>
